home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / switch.zip / SWITCHC.DOC < prev    next >
Text File  |  1993-01-04  |  53KB  |  1,784 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.                                        Switch!
  31.                        Copyright (C)1988-1989 By Curtis Little
  32.                                  All Rights Reserved
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.                    For IBM PCs XTs ATs and PS2s or 100% Compatibles
  47.                                  Supports EMS (3.2+)
  48.  
  49.  
  50.  
  51.  
  52.           Clipper is a trademark of the Nantucket Corp
  53.           dBASE is a trademark of Ashton-Tate
  54.           FoxBase is a trademark of Fox Software
  55.           DesqView is a trademark of QuarterDeck
  56.           MS-DOS/QuickBASIC/MS BASIC are trademarks of Microsoft
  57.           IBM BASIC is a trademark of International Business Machines
  58.           Turbo C/TLINK/Turbo Pascal are trademarks of Borland Intl.
  59.           StarLan is a trademark of AT&T
  60.           NetWare is a trademark of Novell
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                                       Chapter 1
  74.  
  75.                                   Switch! Features
  76.  
  77.  
  78.           Switch! has a large number of features that make it the best
  79.           memory switching function available at any price.  After you see
  80.           what Switch! can do I believe you'll agree that Switch! is
  81.           setting the new standard for memory switching programs.  The
  82.           features currently supported by Switch! are:
  83.  
  84.           *         Switch! to EMS or disk!
  85.  
  86.           (NEW)*    Automatic detection of interrupts in areas to be
  87.                     deallocated for the child process - Returns an error
  88.                     indicator if there's a problem instead of leaving your
  89.                     computer in an UNSAFE state!
  90.  
  91.           (NEW)*    Automatically handles several of the interrupts so you
  92.                     don't have to shut them off first!
  93.  
  94.           (NEW)*    Automatically saves ALL interrupt addresses and then
  95.                     restores them AFTER the child process is complete.
  96.  
  97.           (NEW)     Handles up to 40 MCBs!
  98.  
  99.           (NEW)     Allows you to specify the path and/or the filename to
  100.                     use for the temporary file.
  101.  
  102.           (NEW)     Has a built in fatal error handler!
  103.  
  104.           (NEW)*    The minimum size of the application that remains
  105.                     resident was reduced by 30% with the new version of
  106.                     Switch!.  (Test based on one of the demo programs
  107.                     compared with the same demo linked with the new version
  108.                     of Switch!).
  109.  
  110.           (NEW)     Saves extended handle table.
  111.  
  112.           (NEW)*    Allows a command line of up to 127 characters counting
  113.                     the trailing carriage return.
  114.  
  115.           (NEW)     Switch! now has a utility function that returns the
  116.                     error level of the last child process ran by Switch!
  117.  
  118.           (NEW)     Switch! has functions to allow you to turn on/off (or
  119.                     read the current setting) the flag indicating whether
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                     it should automatically restore the drive and directory
  127.                     after the child program is finished.
  128.  
  129.           (NEW)     New versions of Switch! have been developed to support
  130.                     dBASE III+, FoxBase, and dBASE IV!!!!
  131.  
  132.           (NEW)     A path specification is allowed now instead of the
  133.                     drive making Switch! compatible with Netware and other
  134.                     networks other than StarLan which I use. (The path
  135.                     specification allows you to specify the drive,
  136.                     directory, filename, or any combination of the three
  137.                     for the temp file.)
  138.  
  139.           (NEW)*    The path specification can have multiple paths
  140.                     specified similar to the DOS search path!!!!
  141.  
  142.           (NEW)*    Switch! has a flag (settable by a utility function
  143.                     provided) that tells it whether it's ok to overwrite a
  144.                     filename you SPECIFY for the temp file.  (Switch!
  145.                     doesn't EVER overwrite a file if you don't specify the
  146.                     name).
  147.  
  148.           The features marked with a '*' are features I haven't seen in any
  149.           other available memory switcher to date.  All these features
  150.           clearly make Switch! the leader in the memory switching field.
  151.           Try the new version, I believe you'll be impressed with what you
  152.           see!
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.           Page 2                           Switch! - C Version User's Guide
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                                       Chapter 2
  197.  
  198.                                     Introduction
  199.  
  200.  
  201.           2.1  What you should read
  202.  
  203.  
  204.           A lot of information about Switch! is in this manual.  If you
  205.           don't want to read everything you should AT LEAST read the entire
  206.           chapter titled 'Using Switch!'.  When you read the chapter 'Using
  207.           Switch!' pay close attention to the instructions for linking
  208.           Switch! into your applications.  You should also read the license
  209.           because by using Switch! you are bound by the terms in the
  210.           license agreement.  I personally recommend that you read the
  211.           entire manual, but if you don't at least read the chapter about
  212.           using Switch! you're probably going to have problems linking it
  213.           to your application, and if you do link it in you will be missing
  214.           half the power Switch! provides.
  215.  
  216.  
  217.           2.2  Ok, Back to the Introduction
  218.  
  219.  
  220.           How many times have you wanted to shell out of one program and
  221.           execute another only to find there isn't enough memory left?  If
  222.           only both programs could fit in memory together long enough to
  223.           get the job done... Introducing Switch!.  Switch! is a function
  224.           written in 100% assembly that allows a large application to load
  225.           and run another program whose memory requirements are larger than
  226.           the first application leaves free.  Switch! swaps your
  227.           application to disk or EMS to free memory to load and execute
  228.           another program.  If Switch! had been used in all commercial
  229.           programs a DOS shell would not be missing from any of them and
  230.           there would be more than enough memory to load another large
  231.           application.
  232.  
  233.  
  234.           2.3  Program Requirements
  235.  
  236.  
  237.           Switch! will work properly with most system setups.  The main
  238.           requirement is that DOS 2.0 or above is needed for proper
  239.           operation.  The other requirement is that a disk must be
  240.           available that has enough space to save the switched application,
  241.           or enough EMS (3.2+) to store the switched application.
  242.  
  243.  
  244.  
  245.  
  246.  
  247.           Chapter 2, Introduction                                    Page 3
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.           2.4  Languages Supported
  255.  
  256.  
  257.           Switch! supports QuickBASIC, MS BASIC, IBM BASIC, C, Assembly,
  258.           Turbo Pascal, dBASE III, FoxBase, dBASE IV and Clipper
  259.           applications.  (NOTE:  Only older versions of BASIC are supported
  260.           currently due to the taking over of the keyboard INT by the newer
  261.           ones!).
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.           Page 4                           Switch! - C Version User's Guide
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.                                       Chapter 3
  325.  
  326.                                  Registering Switch!
  327.  
  328.  
  329.           The demonstration version of Switch! along with this
  330.           documentation can be freely copied and shared with
  331.           others.  Although the demonstration version of the software may
  332.           be freely distributed in UNMODIFIED form it is still copyrighted
  333.           software which the author supports.
  334.  
  335.           The demo version provides you a way to test software before
  336.           spending your money.  This helps you get more for your dollar by
  337.           allowing you to "test drive" the software before paying.
  338.  
  339.           The cost of registering Switch! is $20.00.
  340.  
  341.           NOTE:  The demonstration version of Switch! is limited to only
  342.           allow up to two calls.  After the demo version of Switch! has
  343.           been called two times it will no longer attempt to Switch! until
  344.           you reload your application.  This limitation is ONLY in the DEMO
  345.           version of Switch!.  The registered version has no such
  346.           limitation.
  347.  
  348.  
  349.           3.1  Registration Benefits
  350.  
  351.  
  352.           Registering Switch! provides the following benefits:
  353.  
  354.               o  You'll receive a disk containing a non-demo version of
  355.                  Switch!.  Two OBJ files are provided for each language you
  356.                  order Switch! for.  The first OBJ has the top line
  357.                  banners, and the second doesn't.
  358.  
  359.               o  No royalty fees!!
  360.  
  361.               o  Once you've registered Switch! you are free to use it in
  362.                  any future EXECUTABLE applications you develop.
  363.  
  364.               o  Free upgrades.
  365.  
  366.               o  Bulletin Board Support.
  367.  
  368.               o  And once again, source code (for the language(s) you
  369.                  order)!
  370.  
  371.  
  372.  
  373.  
  374.  
  375.           Chapter 3, Registering Switch!                             Page 5
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.           3.1.1  Registration for Businesses
  383.  
  384.           My registration policy is pretty lax.  If a business registers
  385.           Switch! the business may use Switch! freely WITHIN the business
  386.           (I don't want a registration for each machine or each person
  387.           working in the business - the one registration for the business
  388.           is enough).  If Switch! is used in commercial applications I ask
  389.           that I be given credit in the program documentation for
  390.           developing the Switch! part.
  391.  
  392.           NOTE:  If you need a custom version of Switch! please give me a
  393.           call.  I'll be happy to accommodate any requests for customized
  394.           versions that I can.
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.           Page 6                           Switch! - C Version User's Guide
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.                                       Chapter 4
  453.  
  454.                                        License
  455.  
  456.  
  457.           I am offering you a license to use Switch! on a TRIAL BASIS.
  458.           Unregistered versions may be used to write programs which will
  459.           only be used by yourself.  Distribution of programs developed
  460.           with an UNREGISTERED version of Switch! is a direct violation of
  461.           this license agreement.  By using Switch! you acknowledge that
  462.           you have read this agreement, understand it and agree to be bound
  463.           by it's terms and conditions.
  464.  
  465.           Registered versions of Switch! may be used by the REGISTERED
  466.           OWNER to develop programs that may be given away or sold without
  467.           additional license or fees.
  468.  
  469.           You may not give away or sell the non-demo version of Switch! in
  470.           object or source form (or any form from which the object code
  471.           and/or source code can be derived).  You may incorporate the
  472.           object code into your EXECUTABLE programs (which may be given
  473.           away or sold), as long as your programs do not compete (directly
  474.           or indirectly) with Switch!.
  475.  
  476.           Distribution of Switch! or a derivative of Switch! in object or
  477.           object library format (or format that object code can be derived
  478.           from) requires PRIOR written consent from the author (a special
  479.           license/price agreement can be made to allow you to distribute
  480.           Switch! in object/object library format.  Please write if you're
  481.           interested in this special license).
  482.  
  483.           You may not transfer in whole or in part the possesion of Switch!
  484.           to any other person or entity without the prior written consent
  485.           of the author (Curtis Little).
  486.  
  487.           Businesses, government institutions, and other commercial users
  488.           of Switch! MUST register.
  489.  
  490.           If Switch! is used in a commercial application the documentation
  491.           must give the author (Curtis Little) credit for the development
  492.           of Switch!.
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.           Chapter 4, License                                         Page 7
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.                                       Chapter 5
  517.  
  518.                                       Warranty
  519.  
  520.  
  521.           With respect to the physical diskette sent to registered owners,
  522.           the author warrants the same to be free from defects in materials
  523.           and workmanship for a period of 60 days from the date of
  524.           registration.  In the event of notification within the warranty
  525.           period of defects in material or workmanship the author will
  526.           replace the defective diskette.  The remedy for breach of this
  527.           warranty shall be limited to replacement and shall not encompass
  528.           any other damages, including but not limited to loss of profit,
  529.           and special, incidental, consequential, or other similar claims.
  530.  
  531.           The author specifically disclaims all other warranties, expressed
  532.           or implied, including but not limited to implied warranties of
  533.           merchantability and fitness for a particular purpose and the
  534.           program license granted herein in particular, and without
  535.           limiting operation of the program license with respect to any
  536.           particular application, use, or purpose.  IN NO EVENT SHALL THE
  537.           AUTHOR BE LIABLE FOR ANY LOSS OF PROFIT, LOST SAVINGS, COMMERCIAL
  538.           DAMAGE, OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
  539.           OF THE USE OR INABILITY TO USE SWITCH! EVEN IF THE AUTHOR (Curtis
  540.           Little) OR AN AUTHORIZED DISTRIBUTOR OF SWITCH! HAS BEEN ADVISED
  541.           OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER
  542.           PARTY.
  543.  
  544.           This agreement shall be governed by the laws of the state of
  545.           California.
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.           Page 8                           Switch! - C Version User's Guide
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.                                       Chapter 6
  581.  
  582.                                     Using Switch!
  583.  
  584.  
  585.           This chapter covers how to use Switch!.  Before getting into the
  586.           details of using it I'll briefly introduce you to what Switch!
  587.           does for your C applications.  Afterwards the details for calling
  588.           Switch! will be covered followed by an explanation of how to link
  589.           Switch! in with your programs.
  590.  
  591.  
  592.           6.1  How It Works
  593.  
  594.  
  595.           Switch! works by performing a little "magic" with the way DOS
  596.           manages memory.  When called it attempts to free up the amount of
  597.           memory the program requires (or all possible if it can't save as
  598.           much as specified) to disk or EMS.
  599.  
  600.           Switch! reduces the resident portion of a program while another
  601.           is executed by temporarily storing the "parent" program to disk
  602.           or EMS.  After the "child" program is finished the "parent" is
  603.           read back in memory by Switch! and execution resumes where it
  604.           left off (resumes at the point after Switch! was called).
  605.  
  606.           Let's look at an example of how memory looks before you call
  607.           Switch! vs how it looks right before Switch! is ready to load the
  608.           second program.
  609.  
  610.              Before Calling Switch!          After Calling Switch!
  611.                                              (before 2nd program is loaded)
  612.                 +--------------+             +--------------+
  613.                 |              |             |              |
  614.                 | Free memory  |             |              |
  615.                 +--------------+             |              |
  616.                 |Application 1 |             |              |
  617.                 | (Block 2)    |             |              |
  618.                 |--------------|             |              |
  619.                 | Free         |             |              |
  620.                 |--------------|             |              |
  621.                 | Application 1|             | Free memory  |
  622.                 |              |             +--------------+
  623.                 |(First Block) |             |Application 1 |
  624.                 +--------------+             +--------------+
  625.                 | DOS Area     |             | DOS Area     |
  626.                 |              |             |              |
  627.                 +--------------+             +--------------+
  628.  
  629.  
  630.  
  631.           Chapter 6, Using Switch!                                   Page 9
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.           The example above graphically illustrates what Switch! does.  As
  639.           can be seen by the example a lot of memory is cleared by Switch!
  640.           making it available to the program to be loaded.  (Switch! can be
  641.           called over and over from one application to another without
  642.           problems!) - To see this execute the demo program and keep
  643.           telling it to run itself.
  644.  
  645.           Simply put, that's what Switch! does.  There are a lot of options
  646.           available, and several utility functions provided with Switch! to
  647.           control how Switch! operates.
  648.  
  649.  
  650.           6.2  Using Switch!
  651.  
  652.  
  653.           6.2.1  Prototype for Switch!
  654.  
  655.           The prototype for Switch! is as follows:
  656.  
  657.           ** For the C Version **
  658.           int switch_( char *paths, int memrequired, char *command_line] )
  659.  
  660.           The parameters and meanings are:
  661.  
  662.           6.2.1.1  path parameter
  663.  
  664.           PATHS - This parameter specifies the path(s) to try to create the
  665.           temp file on.  This parameter has the same format as the DOS
  666.           search path.  For example, you can specify multiple paths as
  667.           follows:
  668.  
  669.                mPATH = "C:\SWITCH;C:\;D:\STUFF"
  670.                                  ^
  671.                                  |
  672.                                  NOTE:  Each individual path specification
  673.                                  is seperated by a single ;
  674.  
  675.           Each seperate path specification within this parameter can
  676.           contain the drive, directory, file name, or any combination of
  677.           those three.  For instance, if you wanted Switch! to call the
  678.           temp file SWITCH.$$$ and store it on the C: drive the
  679.           specification would be:
  680.  
  681.                mPATH = "C:SWITCH.$$$; ... ETC "
  682.  
  683.           If you don't specify the filename in the path Switch! will create
  684.           a temporary (and yes this works under DOS 2.X also!) file making
  685.           sure no file is overwritten.  However, if you specify the
  686.           filename (and it already exists) Switch!'s behavior depends on
  687.           the setting of the overwrite flag (See the subsection 'Utility
  688.           Functions' on page 12 for information about setting the overwrite
  689.           flag).  If the overwrite flag is turned on Switch! will
  690.           automatically overwrite the file you specified if it exists.  On
  691.           the other hand, when the flag is off Switch! will NOT overwrite
  692.  
  693.  
  694.  
  695.           Page 10                          Switch! - C Version User's Guide
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.           an existing file, instead it will consider that path invalid and
  703.           check the next specified path (or return  error #5 if no more
  704.           paths were specified).  Because of the possibility for lost data
  705.           when a file is overwritten this flag defaults to OFF, but you can
  706.           change it at any time using the SETOVWR() function provided with
  707.           Switch!.
  708.  
  709.           You may be wondering why you'd ever want to use the multiple path
  710.           feature supported by Switch!.  To show one use of this I'll
  711.           explain an example.  Let's say you have a system with a hard
  712.           drive called C:, and a 384K ramdrive called E:.  Since Switching!
  713.           to the ramdrive is many times faster than Switching! to the hard
  714.           drive you'd naturally prefer to Switch! to the ramdrive.
  715.           Consider what happens if Switch! is asked to save more memory
  716.           than can fit on the ramdrive.  If you only specified to go to the
  717.           ramdrive Switch! would have no alternative except to return an
  718.           error saying the ramdrive doesn't have enough space for the temp
  719.           file.  To get around this problem and cause Switch! to use the
  720.           ramdrive when possible you can specify a path with the ramdrive
  721.           specified first followed by the harddrive.  For example:
  722.  
  723.                mPATH = "E:;C:"
  724.  
  725.           The path shown above would cause Switch! to try the ramdrive and
  726.           if it failed Switch! would try the C: drive next.
  727.  
  728.           Switch! tries the path specifications in the order you specified
  729.           them until it finds one that it can store the temporary file to.
  730.  
  731.           If you want Switch! to attempt to create the temporary file in
  732.           the current directory before trying other paths simply put a
  733.           semi-colon as the first character in the path.  For instance:
  734.  
  735.                mPATH = ";C:\SWITCH\"
  736.  
  737.           The above path specification causes Switch! to first try creating
  738.           the temp file on the current drive and directory, and then try
  739.           the C:\SWITCH\ directory if unable to create on the current
  740.           drive/dir.
  741.  
  742.           NOTE:  Specifying a path as NULL causes Switch! to use the
  743.           current drive and directory.
  744.  
  745.  
  746.           6.2.1.2  memory required parameter
  747.  
  748.           memrequired - This parameter specifies the amount of K memory
  749.           required by the program to run.  If the value you specify is more
  750.           than can be saved Switch! will save as much memory as possible.
  751.           A value of zero also causes Switch! to save all memory possible.
  752.  
  753.           Switch! frees memory in an intelligent manner.  Switch! first
  754.           checks to see if the specified amount of memory is free.  If the
  755.           memory isn't already free Switch! will only free enough memory to
  756.  
  757.  
  758.  
  759.           Chapter 6, Using Switch!                                  Page 11
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.           reach the amount specified.  For instance, if you specify the
  767.           program to run needs 64K and there is already 60K free memory
  768.           Switch! will only free 4K to reach the amount specified.
  769.  
  770.           NOTE:  As mentioned above, specifying the memory required as 0
  771.           causes Switch! to free all the memory that it can.
  772.  
  773.  
  774.           6.2.1.3  command line parameter
  775.  
  776.           command_line - This parameter specifies the command line to
  777.           execute after memory is saved.  For instance, a typical command
  778.           line might look like:
  779.                DIR /W /P
  780.           or
  781.                TC temp.c
  782.  
  783.           The command line can be ANY valid DOS command line.  Switch!
  784.           treats the command line as if it were typed at the DOS prompt.
  785.  
  786.  
  787.           NOTES:  The command_line can be a MAXIMUM of 126 characters.  If
  788.           the command_line parameter is longer than 126 characters the
  789.           excess is ignored.
  790.  
  791.           If you specify the command line as NULL ( i.e.
  792.           switch_( "c:", 0, NULL ) or switch_("c:",0,"" ) ) Switch! will
  793.           execute a DOS shell.
  794.  
  795.           6.2.1.4  return value
  796.  
  797.           RETURN VALUE:  The value returned by Switch! indicates whether or
  798.           not an error occurred during the Switch!.  Please see the list of
  799.           error codes at the end of this document for a description of the
  800.           different values returned by Switch! along with the suggested
  801.           actions for each error.  Note that if you use multiple paths
  802.           Switch! will only return an error having to do with no disk space
  803.           etc. if none of the specified paths can be used.
  804.  
  805.           6.2.2  Utility Functions
  806.  
  807.           Switch! has several utility functions provided to allow you to
  808.           configure how Switch! operates and retrieve the error level
  809.           returned by the child process.
  810.  
  811.           The utility functions are:
  812.  
  813.             childret()    - Returns the error level of the last child
  814.                             process executed while Switched! out.
  815.  
  816.             setovwr()     - Sets the value of the overwrite flag.
  817.  
  818.             getovwr()     - Gets the current setting of the overwrite flag.
  819.  
  820.  
  821.  
  822.  
  823.           Page 12                          Switch! - C Version User's Guide
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.             setrestdir()  - Sets the value of the restore directory flag.
  831.  
  832.             getrestdir()  - Gets the current setting of the restore
  833.                          directory flag.
  834.  
  835.           The following text describes the utility functions in detail.
  836.  
  837.           ----------------------------------------------------------------
  838.  
  839.           6.2.2.1  childret()
  840.  
  841.           int childret( void );
  842.  
  843.           This function gets the value of the last child process executed
  844.           from Switch!.
  845.  
  846.           RETURN VALUE:  This function returns an integer value.  A return
  847.           value of -1 indicates that no child processes were executed by
  848.           Switch! (this also happens if you call a DOS shell and the user
  849.           doesn't execute any programs while in the DOS shell).  Any other
  850.           value indicates the error level of the LAST child process
  851.           executed by Switch!.  Note that if you call Switch! to do a DOS
  852.           shell and the user executes more than one program while in the
  853.           shell this function will only return the error level of the last
  854.           one executed!
  855.  
  856.           ----------------------------------------------------------------
  857.  
  858.           6.2.2.2  setovwr()
  859.  
  860.           void setovwr( int flag );
  861.  
  862.           This function sets the value of the overwrite flag.  The
  863.           overwrite flag is only used if you SPECIFY A FILE NAME for the
  864.           temp file that already exists.  If the overwrite flag is ON and
  865.           you specify a file name that already exists it will be
  866.           overwritten by Switch!.  At default the overwrite flag is turned
  867.           OFF to avoid data loss.
  868.  
  869.           INPUT:  The value expected as input is an integer.  A value of 0
  870.           causes the overwrite flag to be turned off, any other value
  871.           causes the overwrite flag to be turned on.
  872.  
  873.           ----------------------------------------------------------------
  874.  
  875.           6.2.2.3  getovwr()
  876.  
  877.           int getovwr( void );
  878.  
  879.           This function gets the current setting of the overwrite flag.
  880.           See the discussion for setovwr() for information on what the
  881.           overwrite flag is.
  882.  
  883.  
  884.  
  885.  
  886.  
  887.           Chapter 6, Using Switch!                                  Page 13
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.           RETURN VALUE:  The value returned is an integer.  A return value
  895.           of 0 indicates the overwrite flag is off, any other value
  896.           indicates it is on.
  897.  
  898.           ----------------------------------------------------------------
  899.  
  900.           6.2.2.4  setrestdir()
  901.  
  902.           void setrestdir( int flag )
  903.  
  904.           This function sets the value of the restore directory flag.  When
  905.           the restore directory flag is ON Switch! will automatically
  906.           restore the drive and directory that were active before the child
  907.           program was executed.  At default this flag is OFF.
  908.  
  909.           INPUT:  The value expected as input is an integer.  Once again a
  910.           value of 0 turns the flag off while any other value causes it to
  911.           be turned on.
  912.  
  913.           ----------------------------------------------------------------
  914.  
  915.           6.2.2.5  getrestdir()
  916.  
  917.           int getrestdir( void )
  918.  
  919.           This function gets the current setting of the restore directory
  920.           flag.  See the discussion of setrestdir() for information about
  921.           what this flag does.
  922.  
  923.           RETURN VALUE:  The value returned by this function is an integer
  924.           value.  A return value of 0 means the restore flag is off, while
  925.           any other value means it's on.
  926.  
  927.  
  928.           6.2.3  Interrupts
  929.  
  930.           Handling of interrupts is something that the new version of
  931.           Switch! makes easier for you.  Switch! now automatically checks
  932.           to see if an interrupt lies in an unsafe area of memory, and if
  933.           one is found to be unsafe Switch! will return an error letting
  934.           you know.  There are a couple of limitations to this feature of
  935.           Switch! however.  First, Switch! only checks interrupts 0 - 28h.
  936.           Second, Switch! can detect if the start of the interrupt handler
  937.           lies in an area of memory that would be deallocated, but it
  938.           doesn't currently check to see if an interrupt that lies in a
  939.           safe area of memory calls any functions that lie in the
  940.           deallocated portion of memory (usually the checking Switch! does
  941.           is enough, but if you find a case where it isn't you'll need to
  942.           turn the problem interrupt off before calling Switch!).  Switch!
  943.           doesn't bother checking interrupts above 28h because they are
  944.           general purpose software interrupts, and aren't usually called by
  945.           another application.  If you take over interrupts above 28h that
  946.           have a possibility of being called by the child program you will
  947.  
  948.  
  949.  
  950.  
  951.           Page 14                          Switch! - C Version User's Guide
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.           need to turn the interrupt off (restore the previous handler)
  959.           BEFORE calling Switch!.
  960.  
  961.           Note that Switch! automatically handles many of the lower
  962.           interrupts.
  963.  
  964.           Switch! also AUTOMATICALLY saves ALL interrupt addresses when it
  965.           is called and then restores them before returning to your
  966.           application.  This overcomes problems with any ill-behaved
  967.           programs ran by Switch! that change interrupts and never restore
  968.           them properly.  No interaction is needed on your part.  Switch!
  969.           is capable of handling the dirty work so you don't have to
  970.           <grin>.
  971.  
  972.  
  973.           6.3  Linking Switch! in Your Applications
  974.  
  975.  
  976.           Switch! is distributed as an object file.  The object file can be
  977.           linked to applications you develop allowing Switch! to be called
  978.           as a function.  The object file for C is called SWITCH.OBJ.  To
  979.           link the file in with your application you simply include the
  980.           module name on the link line.
  981.  
  982.           An example link for the C version of Switch! might look like:
  983.  
  984.               tlink       SC   SWITCH BIGMOD,,,\tc\lib\cl.lib
  985.                           ^       ^
  986.                           |       |
  987.                           |       This is the Switch! OBJ file for C.
  988.                           |
  989.                           This is the first compiled C module!
  990.  
  991.  
  992.           Switch! is only able to free memory from the end of itself up.
  993.           This means that where you place Switch! in the link line will
  994.           have a direct bearing on the maximum amount of memory Switch!
  995.           will be able to free.  For the best results you should either
  996.           link Switch! in as the first module in the program (the first on
  997.           the link line) or write a small program that contains a single
  998.           line (calling the main module of the program).  For example:
  999.  
  1000.           int main( int argc, char *argv[] )
  1001.           {
  1002.               main_module( argc, argv );
  1003.           }
  1004.  
  1005.           Then you could specify Switch! on the link line immediately after
  1006.           the small program module.  I.E.
  1007.  
  1008.                           TLINK TEST SWITCH MAINMOD,,, ...
  1009.  
  1010.           Creating a small program as explained above will make it possible
  1011.           for Switch! to save as much memory as possible.  When linked in
  1012.  
  1013.  
  1014.  
  1015.           Chapter 6, Using Switch!                                  Page 15
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.                                                                    1
  1023.           like this Switch! can free all but around 7-8K of memory  When
  1024.           EMS is used the save/restore of a 640K application is almost
  1025.           instant!
  1026.  
  1027.           Basically speaking the closer Switch! is to the start of the
  1028.           program (i.e. linked in first) the more memory it can free when
  1029.           called.
  1030.  
  1031.  
  1032.           6.4  Switch! on a Network
  1033.  
  1034.  
  1035.           Using Switch! on a Network is not a problem.  It can access the
  1036.           network drives without a hitch since DOS is used for the file
  1037.           I/O.  The path specification parameter makes it possible to work
  1038.           with most networks finally!  In addition there isn't a problem
  1039.           with multiple saves to the same drive because Switch! creates a
  1040.           temporary file (it never overwrites an existing file (unless of
  1041.           course you TELL it to!) - instead a unique name is generated).
  1042.           Note that my saying it creates a temporary file doesn't mean that
  1043.           DOS 3.0 is required - it isn't because I wrote my own function to
  1044.           calculate a temporary file name to make Switch! work with older
  1045.           versions of DOS.
  1046.  
  1047.  
  1048.           6.5  Should I Switch! to EMS or Disk?
  1049.  
  1050.  
  1051.           Actually this isn't a question you have to worry about.  Switch!
  1052.           automatically checks for EMS memory and if there's enough memory
  1053.           to save the program it goes to EMS.  If there isn't any EMS
  1054.           memory (or there isn't enough remaining to switch to) Switch!
  1055.           will attempt to create a disk file.  This means you don't have to
  1056.           worry about whether the target machine has EMS.  Switch! will
  1057.           automatically look for it when called.
  1058.  
  1059.  
  1060.           6.6  Tips on Using Switch!
  1061.  
  1062.  
  1063.           Switch! can work in most applications, but some will require a
  1064.           little attention.  The new interrupt handling functions added to
  1065.           Switch! 2.6 make it automatically handle modified interrupts in
  1066.           most cases.  If your program takes over any interrupts that
  1067.           Switch! isn't able to detect automatically you should either
  1068.           include the module containing the interrupt handler BEFORE
  1069.           Switch!, or turn the interrupts off before calling Switch!.  For
  1070.           example, assuming the ASYNC.OBJ module contained an interrupt
  1071.           handler:
  1072.           _________________________________________________________________
  1073.  
  1074.           1. The Turbo Linker ((TM) Borland International) was used with
  1075.              the demo program for C to come up with the 7-8K value.
  1076.  
  1077.  
  1078.  
  1079.           Page 16                          Switch! - C Version User's Guide
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.                           CORRECT:
  1087.  
  1088.                           link ASYNC SWITCH,,, (etc...)
  1089.  
  1090.                INCORRECT:
  1091.  
  1092.                link SWITCH ASYNC,,, (etc...)
  1093.  
  1094.           The second example is incorrect because when Switch! is called it
  1095.           would see that the memory used by the interrupt handler would be
  1096.           deallocated if it freed all memory possible.  Linking Switch! in
  1097.           this manner will cause it to return an error value indicating
  1098.           that the interrupt is in an unsafe area of memory if you specify
  1099.           enough memory to be freed.
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.           Chapter 6, Using Switch!                                  Page 17
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.                                       Chapter 7
  1157.  
  1158.                                 Switch! Return Values
  1159.  
  1160.  
  1161.           The value returned by Switch! indicates whether an error
  1162.           occurred.  There are many possible errors that fall into two
  1163.           classifications of severity.  This Chapter lists the return
  1164.           values, their meanings, and severity/classification of the error.
  1165.           The suggested corrective actions are simple.  I'll list them by
  1166.           classification.
  1167.  
  1168.           Classification      Suggested Action
  1169.           Warning   This is the type of error that occurs if Switch! can't
  1170.                     successfully write the temp file to disk or EMS.  You
  1171.                     should either ignore this error or print a message
  1172.                     advising the execution of the called program couldn't
  1173.                     be completed.
  1174.  
  1175.           Fatal     The action suggested for this class is simple - there
  1176.                     isn't any action required by your application.  Switch!
  1177.                     has a built in fatal error handler that will print an
  1178.                     error message and drop you to DOS if a fatal error
  1179.                     occurs.  In addition the DOS error level is set to the
  1180.                     error number Switch! uses.
  1181.  
  1182.           Okay, now that I've covered the various classes of errors let's
  1183.           go over the return values from Switch!.
  1184.  
  1185.           Return
  1186.           Value     Description
  1187.           0    No errors occurred.  This is what you want!
  1188.  
  1189.           1    Unable to read file.  This means that an error occurred
  1190.                while reading the temp file back to memory.  <FATAL>
  1191.  
  1192.           2    Temp file is missing on restore!  This error means that the
  1193.                disk with the temp file was removed (or the user deleted the
  1194.                temp file).  <FATAL>
  1195.  
  1196.           3    Can't unallocate memory.  This means that Switch! can't
  1197.                deallocate the memory used by your application.  <WARNING>
  1198.  
  1199.           4    Too many open files.  This means that the DOS maximum number
  1200.                of files that can be open at once is exceeded by the request
  1201.                to open the temp file.  The way to fix this is to increase
  1202.                the number of files in config.sys FILES=15, or to close some
  1203.                of the open files in your application.  <WARNING>
  1204.  
  1205.  
  1206.  
  1207.           Page 18                          Switch! - C Version User's Guide
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.           5    Access Denied.  This means that the root directory you
  1215.                specified for the temp file is full (you really should
  1216.                consider doing a little file management!).  Switch! doesn't
  1217.                attempt to create the file in the root directory unless you
  1218.                specify to!  This error is also possible if you set the
  1219.                overwrite flag ON and then specify a name for the temp file
  1220.                that already exists as a read only file.  <WARNING>
  1221.  
  1222.           6    Can't locate COMMAND.COM.  This error means that Switch!
  1223.                couldn't locate COMMAND.COM using the COMSPEC environment
  1224.                variable.  (COMMAND.COM must be available for Switch! to
  1225.                execute a program).  <WARNING>
  1226.  
  1227.           7    Memory control blocks are damaged.  This means it's probably
  1228.                time to reboot the machine!   <FATAL>
  1229.  
  1230.           8    Not enough memory to reload the original program.  This
  1231.                error could be caused if the user loads a TSR and then exits
  1232.                back to the first application.  <FATAL>.
  1233.  
  1234.                This error can also mean that there wasn't enough memory to
  1235.                load a copy of COMMAND.COM to execute the command line.  If
  1236.                control returns to your program it was because COMMAND.COM
  1237.                couldn't be loaded.  The other problem marked as FATAL for
  1238.                this error causes Switch! to abort the program.  <WARNING>
  1239.  
  1240.           9    Error reading EMS.  This error means that an error occurred
  1241.                while Switch! was restoring the program from EMS.  <FATAL>
  1242.  
  1243.           10   Not enough disk space.  This error means the drive to store
  1244.                the temp file on doesn't have enough free space to save the
  1245.                file (Switch! checks the disk space before attempting to
  1246.                create the file).  <WARNING>
  1247.  
  1248.           11   Invalid Drive.  This error means the drive specified to
  1249.                create the temp file on is invalid.  <WARNING>
  1250.  
  1251.           12   Error writing the file.  This should never occur since
  1252.                Switch! checks the drive space before starting, but I check
  1253.                for this condition just in case.  <WARNING>
  1254.  
  1255.           14   Too many file handles!  This means that Switch! can't
  1256.                properly save the extended file handle table because there
  1257.                are too many handles in it.  Switch! can only handle 255
  1258.                handles!  Out of curiousity how did you get DOS to allow
  1259.                more?  <WARNING>
  1260.  
  1261.           15   Bad path.  This means that the last path specified for the
  1262.                temporary file has a non-existent directory in it.
  1263.                <WARNING>
  1264.  
  1265.           16   File exists.  This means that the file name you specified
  1266.                for the temp file already exists.  This error is only
  1267.                returned if the overwrite flag is OFF.  When the overwrite
  1268.  
  1269.  
  1270.  
  1271.           Chapter 7, Switch! Return Values                          Page 19
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.                flag is ON any file you specify is overwritten without
  1279.                hesitation <grin>.  <WARNING>
  1280.  
  1281.                Any error greater than 255 means that there is an interrupt
  1282.                that lies in an area that would be deallocated if Switch!
  1283.                freed the amount of memory requested.  To get the number of
  1284.                the interrupt that is unsafe simply divide the error number
  1285.                returned by 256.  For example:
  1286.  
  1287.                     ret_val = SWITCH( "", 0, "" );
  1288.  
  1289.                if (ret_val > 255 )
  1290.                     printf( "Interrupt %d ", ret_val / 256 );
  1291.                     printf( "would be in an unsafe area of memory." );
  1292.  
  1293.  
  1294.                <WARNING>
  1295.  
  1296.           As you can see there are quite a few different return values.
  1297.           Luckily the odds are against the fatal errors occurring (but they
  1298.           are possible).
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.           Page 20                          Switch! - C Version User's Guide
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.                                       Chapter 8
  1349.  
  1350.                                      Background
  1351.  
  1352.  
  1353.           There are several reasons why I developed Switch!.  The most
  1354.           important reason is that a lot of the work I do involves large
  1355.           data base applications in a network environment.  By the time you
  1356.           add in the memory required by the average Clipper application I'm
  1357.           working on with the high overhead for the network software that
  1358.           is resident it is common to not even have enough memory left over
  1359.           to execute a DOS shell (that really hurts the application when
  1360.           you consider that to link to any of the network drives/printers a
  1361.           DOS command needs to be executed).  Finally after getting
  1362.           frustrated with 640K not being enough memory I created Switch! to
  1363.           solve the memory shortage problems.
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.           Chapter 8, Background                                     Page 21
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.           Page 22                          Switch! - C Version User's Guide
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.                                      Appendix A
  1477.  
  1478.                                Example Call to Switch!
  1479.  
  1480.  
  1481.           This appendix will show an example of calling Switch!.
  1482.  
  1483.           C Example:
  1484.  
  1485.                /**
  1486.                 ** The path specification listed next tells Switch!
  1487.                 ** to first try creating the file on the C drive in
  1488.                 ** a directory called \SWITCH using a file name of
  1489.                 ** SWITCH.$$$.  If unable to create the file there
  1490.                 ** Switch! will then try the current directory of
  1491.                 ** the D drive, and if unable to use the D drive
  1492.                 ** Switch! will try the current directory of the
  1493.                 ** E drive.  If unable to create the file on all
  1494.                 ** of the specified paths Switch! will return an
  1495.                 ** error (the error specifically says why it couldn't
  1496.                 ** create the file on the LAST path specified).
  1497.                 **/
  1498.  
  1499.                path = "C:\SWITCH\SWITCH.$$$;D:SWITCH.$$$;E:SWITCH.$$$";
  1500.  
  1501.                memrequired = 64;             && insure 64K is free
  1502.  
  1503.                /** Turn off the overwrite flag to insure we don't
  1504.                 **  overwrite an existing file.
  1505.                 **/
  1506.                setovwr( 0 );
  1507.  
  1508.                /** Turn on the restore directory flag to cause Switch!
  1509.                 **  to restore the current drive and directory when it's
  1510.                 **  finished
  1511.                 **/
  1512.                setrestdir( 1 );
  1513.  
  1514.                /** Now call switch to execute TED to edit names.txt
  1515.                 ** This is the magical moment we've been waiting for...
  1516.                 **/
  1517.  
  1518.                switch( path, memrequired, "TED names.txt" );
  1519.  
  1520.                /** Now you'd have whatever code you wanted to execute after
  1521.                 ** the child process is called.
  1522.                 **/
  1523.  
  1524.  
  1525.  
  1526.  
  1527.           Chapter 1, Example Call to Switch!                        Page 23
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.           Please see the demo program included with Switch! to see another
  1535.           example of calling Switch! from a C application
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.           Page 24                          Switch! - C Version User's Guide
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.                                         Index
  1605.  
  1606.  
  1607.                  C                           getting child error
  1608.                  C                              level 13
  1609.                     example link line 15     getting options 12
  1610.                     function name 10
  1611.                  calling Switch!             I
  1612.                     examples 23              interrupts
  1613.                  child error level 12           special
  1614.                  command_line parameter         considerations 16
  1615.                     12
  1616.                  configuring Switch! 12      L
  1617.                  considerations              languages supported 4
  1618.                     interrupts 16            License agreement 7
  1619.                                              link line
  1620.                  D                              example for C 15
  1621.                  description                 Linking Switch! to
  1622.                     of parameters 10            applications 15
  1623.                  drive parameter
  1624.                     meaning 10               M
  1625.                                              memory
  1626.                  E                              freeing more 15
  1627.                  EMS                            tips to free more 15
  1628.                     support for 9, 16        memrequired parameter
  1629.                     use of 16                   11
  1630.                  error level
  1631.                     getting 13               N
  1632.                     getting childs 12        name
  1633.                  example                        function for C 10
  1634.                     calls to Switch! 23      name for C 10
  1635.                     link line for C 15       Network use 16
  1636.  
  1637.                  F                           O
  1638.                  flags                       object files
  1639.                     overwrite 13                linking 15
  1640.                     restore directory 14     options
  1641.                  freeing                        getting 12
  1642.                     more memory 15              setting 12
  1643.                  functions                   overwrite flag
  1644.                     utility 12                  getting 13
  1645.                                                 setting 13
  1646.                  G
  1647.                  getting                     P
  1648.                     error level of child     parameters
  1649.                     12                          command_line 12
  1650.                     overwrite flag 13           drive 10
  1651.                     restore directory 14        memrequired 11
  1652.  
  1653.  
  1654.  
  1655.           Chapter 1, Index                                          Page 25
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.                  parameters for Switch!         restore directory 14
  1663.                     10                       setting options 12
  1664.                                              Switch!
  1665.                  R                              tips 16
  1666.                  requirements                   use on a network 16
  1667.                     system 3                 Switch! parameters 10
  1668.                  restore directory           Switch! return value 12
  1669.                     getting 14               Switch! return values
  1670.                     setting 14                  18
  1671.                  return value                system
  1672.                     for Switch! 12              requirements 3
  1673.                  return values
  1674.                     meanings 18              U
  1675.                                              Utility functions 12
  1676.                  S
  1677.                  setting                     W
  1678.                     overwrite flag 13        Warranty 8
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.           Page 26                          Switch! - C Version User's Guide
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.                                     Contents
  1733.  
  1734.  
  1735.  
  1736.                Chapter 1  Switch! Features                           1
  1737.  
  1738.                Chapter 2  Introduction                               3
  1739.                   2.1  What you should read  . . . . . . . . . . . . 3
  1740.                   2.2  Ok, Back to the Introduction  . . . . . . . . 3
  1741.                   2.3  Program Requirements  . . . . . . . . . . . . 3
  1742.                   2.4  Languages Supported . . . . . . . . . . . . . 4
  1743.  
  1744.                Chapter 3  Registering Switch!                        5
  1745.                   3.1  Registration Benefits . . . . . . . . . . . . 5
  1746.                      3.1.1  Registration for Businesses  . . . . . . 6
  1747.  
  1748.                Chapter 4  License                                    7
  1749.  
  1750.                Chapter 5  Warranty                                   8
  1751.  
  1752.                Chapter 6  Using Switch!                              9
  1753.                   6.1  How It Works  . . . . . . . . . . . . . . . . 9
  1754.                   6.2  Using Switch! . . . . . . . . . . . . . . .  10
  1755.                      6.2.1  Prototype for Switch!  . . . . . . . .  10
  1756.                         6.2.1.1  path parameter  . . . . . . . . .  10
  1757.                         6.2.1.2  memory required parameter . . . .  11
  1758.                         6.2.1.3  command line parameter  . . . . .  12
  1759.                         6.2.1.4  return value  . . . . . . . . . .  12
  1760.                      6.2.2  Utility Functions  . . . . . . . . . .  12
  1761.                         6.2.2.1  childret()  . . . . . . . . . . .  13
  1762.                         6.2.2.2  setovwr() . . . . . . . . . . . .  13
  1763.                         6.2.2.3  getovwr() . . . . . . . . . . . .  13
  1764.                         6.2.2.4  setrestdir()  . . . . . . . . . .  14
  1765.                         6.2.2.5  getrestdir()  . . . . . . . . . .  14
  1766.                      6.2.3  Interrupts . . . . . . . . . . . . . .  14
  1767.                   6.3  Linking Switch! in Your Applications  . . .  15
  1768.                   6.4  Switch! on a Network  . . . . . . . . . . .  16
  1769.                   6.5  Should I Switch! to EMS or Disk?  . . . . .  16
  1770.                   6.6  Tips on Using Switch! . . . . . . . . . . .  16
  1771.  
  1772.                Chapter 7  Switch! Return Values                     18
  1773.  
  1774.                Chapter 8  Background                                21
  1775.  
  1776.                Appendix A  Example Call to Switch!                  23
  1777.  
  1778.                Index                                                25
  1779.  
  1780.  
  1781.  
  1782.  
  1783.                                           i
  1784.